package com.xi.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: xjs
 * @Date: 2022/11/19/10:45
 * @Description:
id
user_id
orgin_url
short_url_id
last_visit
visits
 */
@Data
@NoArgsConstructor
@TableName("tbl_url")
public class Url {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String originUrl;
    private String shortUrlId;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date lastVisit;
    private Integer visits;
    private Long userId;
//    private User user;

//    public Url(Integer id, String originUrl, String shortUrlId, Date lastVisit, Integer visits) {
//        this.id = id;
//        this.originUrl = originUrl;
//        this.shortUrlId = shortUrlId;
//        this.lastVisit = lastVisit;
//        this.visits = visits;
//    }

//    public User getUser() {
//        return user;
//    }
//
//    public void setUser(User user) {
//        this.user = user;
//    }
}
